//键盘鼠标
package lwsoft

//MoveTo 把鼠标移动到目的点(x,y)
func (com *LwSoft) MoveTo(x, y int) int {
	ret, _ := com.lw.CallMethod("MoveTo", x, y)
	return int(ret.Val)
}

//MoveToEx 把鼠标移动到目的范围内的任意一点
func (com *LwSoft) MoveToEx(x, y, w, h int) int {
	ret, _ := com.lw.CallMethod("MoveToEx", x, y, w, h)
	return int(ret.Val)
}

//LeftClick 按下鼠标左键
func (com *LwSoft) LeftClick() int {
	ret, _ := com.lw.CallMethod("LeftClick")
	return int(ret.Val)
}

//LeftDoubleClick 双击鼠标左键
func (com *LwSoft) LeftDoubleClick() int {
	ret, _ := com.lw.CallMethod("LeftDoubleClick")
	return int(ret.Val)
}

//EnableKeyMouseSync 设置后台键盘鼠标采有同步或者异步消息模式。默认为异步。
func (com *LwSoft) EnableKeyMouseSync(mode int) int {
	ret, _ := com.lw.CallMethod("EnableKeyMouseSync", mode)
	return int(ret.Val)
}

//EnableRealMouse 鼠标动作模拟真实操作,带移动轨迹,以及点击延时随机.
func (com *LwSoft) EnableRealMouse(enable, mousedelay, mousestep int) int {
	ret, _ := com.lw.CallMethod("EnableRealMouse", enable, mousedelay, mousestep)
	return int(ret.Val)
}

//SetMouseDelay 设置鼠标单击或者双击时,鼠标按下和弹起的时间间隔
func (com *LwSoft) SetMouseDelay(delay int) int {
	ret, _ := com.lw.CallMethod("SetMouseDelay", delay)
	return int(ret.Val)
}

//SetRandomDelay 默认键盘鼠标在按下弹起，移动时会在设置的延时间隔的基础加上一点随机延时
func (com *LwSoft) SetRandomDelay(delay int) int {
	ret, _ := com.lw.CallMethod("SetRandomDelay", delay)
	return int(ret.Val)
}
